*** Replication code for the robustness checks presented in
*** Multiple Measurements, Elusive Agreement, and Unstable Outcomes in the Study of Regime Change
*** Hans Lueders and Ellen Lust
*** October 2017



******************************************************************************************
**********************1. Houle 2009*******************************************************
******************************************************************************************

*** read in data
use "WP2009_regimechangedata.dta", clear


*** replication of the original model (T4, M1):
probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem



*** Bernhard et al.
* can't do this because this variable doesn't allow for the identification of democracies/ autocracies
   

*** Boix et al.
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_boix
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_boix)
sort country year
by country: gen breakdown_boix_lag = breakdown_boix[_n-1]
bysort country (year): gen stra = sum(breakdown_boix_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem


*** Cheibub et al.
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_cgv
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_cgv)
sort country year
by country: gen breakdown_cgv_lag = breakdown_cgv[_n-1]
bysort country (year): gen stra = sum(breakdown_cgv_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem


*** Freedom House
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_fh_free_status
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_fh_free_status)
sort country year
by country: gen breakdown_fh_free_status_lag = breakdown_fh_free_status[_n-1]
bysort country (year): gen stra = sum(breakdown_fh_free_status_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem


*** Geddes et al.
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_gwf
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_gwf)
sort country year
by country: gen breakdown_gwf_lag = breakdown_gwf[_n-1]
bysort country (year): gen stra = sum(breakdown_gwf_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem


*** Magaloni et al.
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_magaloni
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_magaloni)
sort country year
by country: gen breakdown_magaloni_lag = breakdown_magaloni[_n-1]
bysort country (year): gen stra = sum(breakdown_magaloni_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem


*** Polity
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_polity
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_polity)
sort country year
by country: gen breakdown_polity_lag = breakdown_polity[_n-1]
bysort country (year): gen stra = sum(breakdown_polity_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem


*** Reich
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_reich
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_reich)
sort country year
by country: gen breakdown_reich_lag = breakdown_reich[_n-1]
bysort country (year): gen stra = sum(breakdown_reich_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem


*** Svolik
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_svolik
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_svolik)
sort country year
by country: gen breakdown_svolik_lag = breakdown_svolik[_n-1]
bysort country (year): gen stra = sum(breakdown_svolik_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem


*** Ulfelder
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_ulfelder
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_ulfelder)
sort country year
by country: gen breakdown_ulfelder_lag = breakdown_ulfelder[_n-1]
bysort country (year): gen stra = sum(breakdown_ulfelder_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem


*** Wahman et al.
drop ndem dem capshare_dem loglevel_dem g_dem oil_dem moslem_dem cath_dem prot_dem ethnic_dem religion_dem britcol_dem newc_dem stra stra_dem odwp odwp_dem 

gen dem = democracy_htw
sort country year
by country: gen ndem = dem[_n+1]
bysort year: egen odwp = mean(democracy_htw)
sort country year
by country: gen breakdown_htw_lag = breakdown_htw[_n-1]
bysort country (year): gen stra = sum(breakdown_htw_lag)

foreach var in capshare loglevel g oil moslem cath prot ethnic religion britcol newc stra odwp{
	gen `var'_dem = 0 if `var' != . & dem ==0
	replace `var'_dem = `var' if dem==1
} 


probit ndem dem capshare capshare_dem loglevel loglevel_dem g g_dem oil oil_dem moslem moslem_dem cath cath_dem prot prot_dem ethnic ethnic_dem religion religion_dem britcol britcol_dem newc newc_dem stra stra_dem odwp odwp_dem pres 
lincom capshare+capshare_dem
lincom loglevel+loglevel_dem
lincom g+g_dem
lincom oil+oil_dem
lincom moslem+ moslem_dem
lincom cath+cath_dem
lincom prot+prot_dem
lincom ethnic+ethnic_dem
lincom religion+religion_dem
lincom britcol+britcol_dem
lincom newc+newc_dem
lincom stra+stra_dem
lincom pres
lincom odwp+odwp_dem




******************************************************************************************
**********************2. Pevehouse 2002***************************************************
******************************************************************************************

*** read in data
use "IOdata_regimechangedata.dta", clear


*** replication of the original models (T3, M1-M4):
eststo clear
eststo: logit P98transition IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0, cluster(ccode)
eststo: logit GSRtransition IOScore dIOScore pcGDP dpcGDP contagGS pastdemGS regionalmids domviolence milreg indep if sampleGS==1, cluster(ccode)
eststo: logit P98transition IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0, cluster(ccode)
eststo: logit GSRtransition IOScoreall dIOScoreall pcGDP dpcGDP contagGS pastdemGS regionalmids domviolence milreg indep if sampleGS==1, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend


*** Boix et al. 
eststo clear
eststo: logit transition_boix IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_boix_lag==0, cluster(ccode)
eststo: logit transition_boix IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_boix_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend

*** Cheibub et al. 
eststo clear
eststo: logit transition_cgv IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_cgv_lag==0, cluster(ccode)
eststo: logit transition_cgv IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_cgv_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend

*** Freedom House
eststo clear
eststo: logit transition_fh_free_status IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_fh_free_status_lag==0, cluster(ccode)
eststo: logit transition_fh_free_status IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_fh_free_status_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend

*** Geddes et al. 
eststo clear
eststo: logit transition_gwf IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_gwf_lag==0, cluster(ccode)
eststo: logit transition_gwf IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_gwf_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend
	
*** Magaloni et al. 
eststo clear
eststo: logit transition_magaloni IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_magaloni_lag==0, cluster(ccode)
eststo: logit transition_magaloni IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_magaloni_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend
			
*** Polity
eststo clear
eststo: logit transition_polity IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_polity_lag==0, cluster(ccode)
eststo: logit transition_polity IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_polity_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend
			
*** Reich 
eststo clear
eststo: logit transition_reich IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_reich_lag==0, cluster(ccode)
eststo: logit transition_reich IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_reich_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend

*** Svolik
eststo clear
eststo: logit transition_svolik IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_svolik_lag==0, cluster(ccode)
eststo: logit transition_svolik IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_svolik_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend
	
*** Ulfelder 
eststo clear
eststo: logit transition_ulfelder IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_ulfelder_lag==0, cluster(ccode)
eststo: logit transition_ulfelder IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_ulfelder_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend
	
*** Wahman et al. 
eststo clear
eststo: logit transition_htw IOScore dIOScore pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_htw_lag==0, cluster(ccode)
eststo: logit transition_htw IOScoreall dIOScoreall pcGDP dpcGDP contagP98 pastdemP98 regionalmids domviolence milreg indep if sampleP98==0 & democracy_htw_lag==0, cluster(ccode)
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N ll chi2 p r2_p, fmt(0 3 3 3) label("N" "Log Likelihood" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend
		




******************************************************************************************
**********************3. Donno 2013*******************************************************
******************************************************************************************

*** read in data
use "Donno_regimechangedata.dta", clear


*** replication of the original models (T1, M3 & M5)
eststo clear
eststo: xi: probit ed_trans i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit ed_trans i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label


*** Boix et al.
eststo clear
eststo: xi: probit transition_boix i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_boix i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label

*** Cheibub et al.
eststo clear
eststo: xi: probit transition_cgv i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_cgv i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label

*** Freedom House
eststo clear
eststo: xi: probit transition_fh_free_status i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_fh_free_status i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label

*** Geddes et al.
eststo clear
eststo: xi: probit transition_gwf i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_gwf i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label

*** Magaloni et al. 
eststo clear
eststo: xi: probit transition_magaloni i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_magaloni i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label

*** Polity
eststo clear
eststo: xi: probit transition_polity i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_polity i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label

*** Reich
eststo clear
eststo: xi: probit transition_reich i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_reich i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label

*** Svolik
eststo clear
eststo: xi: probit transition_svolik i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_svolik i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label

*** Ulfelder
eststo clear
eststo: xi: probit transition_ulfelder i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_ulfelder i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label

*** Wahman et al.
eststo clear
eststo: xi: probit transition_htw i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
eststo: xi: probit transition_htw i.gwf_compauth_lag1*opp_coalitiontotal i.gwf_compauth_lag1*extcondpre chiefelec ///
   hm_incrun_fill eleccount_auth loggdppc_lag1 gdpgrowth_lag1 cee americas hm_incpartylose_chief_lag1el flaws_intens priorlib_fh regopen_lag2yravg if ///
   (gwf_compauth_lag1==1|gwf_hegauth_lag1==1)&cyrdrop~=1&pre_indep~=1&fh_elecdemoc_lag1~=1&gwf_prov_auth~=1, cluster(ccode) nolog
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p ll, fmt(0 3 3) label("N" "Pseudo-R2" "Log Likelihood")) legend label




******************************************************************************************
**********************4. Andersen et al. 2014*********************************************
******************************************************************************************

*** read in data
use "Andersen_et_al_regimechangedata.dta", clear

*** Panelvar settings
xtset ccode_cow year
xtdes


*** replication of the original models (T1, M3 & M6)
eststo clear   
eststo: xtprobit democbreak l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount
eststo: xtprobit democbreak l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2 p, fmt(0 3 3) label("N" "R2" "Prob > F")) legend label


*** Bernhard et al.
eststo clear
eststo: xtprobit breakdown_bnr l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount
eststo: xtprobit breakdown_bnr l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label

*** Boix et al.	
eststo clear
eststo: xtprobit breakdown_boix l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_boix_lag==1
eststo: xtprobit breakdown_boix l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount	if democracy_boix_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label

*** Cheibub et al.
eststo clear
eststo: xtprobit breakdown_cgv l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_cgv_lag==1
eststo: xtprobit breakdown_cgv l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_cgv_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label

*** Freedom House
eststo clear
eststo: xtprobit breakdown_fh_free_status l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_fh_free_status_lag ==1
eststo: xtprobit breakdown_fh_free_status l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_fh_free_status_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label

*** Geddes et al.
eststo clear
eststo: xtprobit breakdown_gwf l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_gwf_lag==1
eststo: xtprobit breakdown_gwf l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_gwf_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label

*** Magaloni et al.
eststo clear
eststo: xtprobit breakdown_magaloni l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_magaloni_lag==1
eststo: xtprobit breakdown_magaloni l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount	if democracy_magaloni_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label
		
*** Polity
eststo clear
eststo: xtprobit breakdown_polity l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_polity_lag==1
eststo: xtprobit breakdown_polity l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_polity_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label
	
*** Reich
eststo clear
eststo: xtprobit breakdown_reich l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_reich_lag==1
eststo: xtprobit breakdown_reich l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount	if democracy_reich_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label

** Svolik
eststo clear
eststo: xtprobit breakdown_svolik l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_svolik_lag==1
eststo: xtprobit breakdown_svolik l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount	if democracy_svolik_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label
	
*** Ulfelder
eststo clear
eststo: xtprobit breakdown_ulfelder l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_ulfelder_lag==1
eststo: xtprobit breakdown_ulfelder l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount	if democracy_ulfelder_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label

*** Wahman et al.
eststo clear
eststo: xtprobit breakdown_htw l.icrg_bur l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_htw_lag==1
eststo: xtprobit breakdown_htw l.icrg_bur  l.lnpwtgdpcap l.pwtgrowth l.lnoil_valuecap l.armcon l.intwar l.i.democtype time time2 time3 spellcount if democracy_htw_lag==1
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N p, fmt(0 3 3) label("N" "Prob > F")) legend label




******************************************************************************************
**********************5. Burke and Leigh 2010*********************************************
******************************************************************************************

*** read in data
use "BurkeLeigh_regimechangedata.dta", clear


*** replication of original model (T3, M1-M4)
eststo clear
eststo: xi: clogit demchangeevent laggrowthpercapita i.year if sample2007==1 & lpolity<8, group(ccode) cluster(ccode) or
eststo: xi: clogit demchangeevent laggrowthpercapita develop2_2 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if e(sample), group(ccode) cluster(ccode) or
eststo: xi: clogit autchangeevent laggrowthpercapita i.year if sample2007==1 & lpolity>-8, group(ccode) cluster(ccode) or
eststo: xi: clogit autchangeevent laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if e(sample), group(ccode) cluster(ccode) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p p, fmt(0 3 3) label("N" "Pseudo-R2" "Prob > F")) legend label eform 
	
	
	
* 1. All observations *
*---------------------*	

*** Freedom House
eststo clear
eststo:	xi: clogit liberal_fh_score laggrowthpercapita i.year if sample2007==1 & fh_score_lag >1, group(ccode) cluster(ccode) or
eststo:	xi: clogit liberal_fh_score laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & fh_score_lag >1, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_fh_score laggrowthpercapita i.year if sample2007==1 & fh_score_lag<7, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_fh_score laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & fh_score_lag<7, group(ccode) cluster(ccode) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p p, fmt(0 3 3) label("N" "Pseudo-R2" "Prob > F")) legend label eform ///
   keep(laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy )
					
*** Polity
sort ccode year
eststo clear
eststo:	xi: clogit liberal_polity laggrowthpercapita i.year if sample2007==1 &  p_polity2_lag<10, group(ccode) cluster(ccode) or
eststo:	xi: clogit liberal_polity laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 &  p_polity2_lag<10, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_polity laggrowthpercapita i.year if sample2007==1 &  p_polity2_lag>-10, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_polity laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 &  p_polity2_lag>-10, group(ccode) cluster(ccode) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p p, fmt(0 3 3) label("N" "Pseudo-R2" "Prob > F")) legend label eform ///
   keep(laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy )
   
*** Skaaning et al. 
sort ccode_cow year
by ccode_cow: gen liedlexical_index_lag = liedlexical_index[_n-1]
eststo clear
eststo:	xi: clogit liberal_lexical laggrowthpercapita i.year if sample2007==1 & liedlexical_index_lag <6, group(ccode) cluster(ccode) or
eststo:	xi: clogit liberal_lexical laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & liedlexical_index_lag <6, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_lexical laggrowthpercapita i.year if sample2007==1 & liedlexical_index_lag >0 &  liedlexical_index_lag !=., group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_lexical laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & liedlexical_index_lag >0 &  liedlexical_index_lag !=., group(ccode) cluster(ccode) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p p, fmt(0 3 3) label("N" "Pseudo-R2" "Prob > F")) legend label eform ///
   keep(laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy )
   							
*** Wahman et al. 
eststo clear
eststo:	xi: clogit liberal_htw laggrowthpercapita i.year if sample2007==1 & htw_ifhpol_lag <10, group(ccode) cluster(ccode) or
eststo:	xi: clogit liberal_htw laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & htw_ifhpol_lag <10, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_htw laggrowthpercapita i.year if sample2007==1 & htw_ifhpol_lag >0, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_htw laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & htw_ifhpol_lag >0, group(ccode) cluster(ccode) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p p, fmt(0 3 3) label("N" "Pseudo-R2" "Prob > F")) legend label eform ///
   keep(laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy )
   
** V-Dem: electoral democracy
eststo clear
eststo:	xi: clogit liberal_vdem_elec laggrowthpercapita i.year if sample2007==1 & vdem_v2x_polyarchy_lag <0.957, group(ccode) cluster(ccode) or
eststo:	xi: clogit liberal_vdem_elec laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & vdem_v2x_polyarchy_lag <0.957, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_vdem_elec laggrowthpercapita i.year if sample2007==1 & vdem_v2x_polyarchy_lag >0.043, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_vdem_elec laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & vdem_v2x_polyarchy_lag >0.043, group(ccode) cluster(ccode) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p p, fmt(0 3 3) label("N" "Pseudo-R2" "Prob > F")) legend label eform ///
   keep(laggrowthpercapita develop2_4 lpolity ldurable lregsharedemocracy )


* 2. DEM/AUT only *
*-----------------*	
   
*** Freedom House
eststo clear
eststo:	xi: clogit liberal_fh_score laggrowthpercapita i.year if sample2007==1 & fh_score_lag >=4, group(ccode) cluster(ccode) or
eststo:	xi: clogit liberal_fh_score laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & fh_score_lag >=4, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_fh_score laggrowthpercapita i.year if sample2007==1 & fh_score_lag<4, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_fh_score laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & fh_score_lag<4, group(ccode) cluster(ccode) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p p, fmt(0 3 3) label("N" "Pseudo-R2" "Prob > F")) legend label eform ///
   keep(laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy )

*** Polity
eststo clear
eststo:	xi: clogit liberal_polity laggrowthpercapita i.year if sample2007==1 &  p_polity2_lag<=0, group(ccode) cluster(ccode) or
eststo:	xi: clogit liberal_polity laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 &  p_polity2_lag<=0, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_polity laggrowthpercapita i.year if sample2007==1 &  p_polity2_lag>0, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_polity laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 &  p_polity2_lag>0, group(ccode) cluster(ccode) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p p, fmt(0 3 3) label("N" "Pseudo-R2" "Prob > F")) legend label eform ///
   keep(laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy )
   	
*** Skaaning et al.
* omitted, because there is no way to identify dem/aut on the Lexical Index of Democracy

*** Wahman et al.
eststo clear
eststo:	xi: clogit liberal_htw laggrowthpercapita i.year if sample2007==1 & htw_ifhpol_lag <7, group(ccode) cluster(ccode) or
eststo:	xi: clogit liberal_htw laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & htw_ifhpol_lag <7, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_htw laggrowthpercapita i.year if sample2007==1 & htw_ifhpol_lag >=7, group(ccode) cluster(ccode) or
eststo:	xi: clogit backslide_htw laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy i.year if sample2007==1 & htw_ifhpol_lag >=7, group(ccode) cluster(ccode) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2_p p, fmt(0 3 3) label("N" "Pseudo-R2" "Prob > F")) legend label eform ///
   keep(laggrowthpercapita develop2_4 l2grosssecondcombinedextra l2old lpolity ldurable lregsharedemocracy )
 
*** V-Dem: 
* omitted, because there is no way to identify dem/aut on the V-Dem measures.

			
	
******************************************************************************************
**********************6. Cornell 2013*****************************************************
******************************************************************************************

*** read in data
use "Cornell_regimechangedata.dta", clear

xtset ccode year, yearly

*** replication of original model: T1, M3
eststo clear
eststo: xtpcse d.fh_ipolity l.fh_ipolity l.demaidcorepop l.allbutdemaidcorepop ///
l.unna_gdpc_1000 l.unna_otco l.unna_grgdp al_religion al_ethnic ///
easteur lat northafmideas subsahaf westeur eastas southeastas southas pacif ///
l.reg_monarchy l.reg_military l.reg_multiparty l.reg_noparty l.reg_other l.reg_democracy ///
lhtw_mondemaid_pop lhtw_mildemaid_pop lhtw_multidemaid_pop lhtw_nopardemaid_pop lhtw_otherdemaid_pop lhtw_demdemaid_pop if year>1989,p 
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2 p, fmt(0 3 3) label("N" "R2" "Prob > F")) legend label

		
		
* 1. All observations *
*---------------------*	

*** Freedom House
eststo clear
eststo: xtpcse liberal_fh_score l.demaidcorepop l.allbutdemaidcorepop ///
l.unna_gdpc_1000 l.unna_otco l.unna_grgdp al_religion al_ethnic ///
easteur lat northafmideas subsahaf westeur eastas southeastas southas pacif ///
l.reg_monarchy l.reg_military l.reg_multiparty l.reg_noparty l.reg_other l.reg_democracy ///
lhtw_mondemaid_pop lhtw_mildemaid_pop lhtw_multidemaid_pop lhtw_nopardemaid_pop lhtw_otherdemaid_pop lhtw_demdemaid_pop if year>1989 & fh_score_lag >1,p 

*** Polity
eststo: xtpcse liberal_polity l.demaidcorepop l.allbutdemaidcorepop ///
l.unna_gdpc_1000 l.unna_otco l.unna_grgdp al_religion al_ethnic ///
easteur lat northafmideas subsahaf westeur eastas southeastas southas pacif ///
l.reg_monarchy l.reg_military l.reg_multiparty l.reg_noparty l.reg_other l.reg_democracy ///
lhtw_mondemaid_pop lhtw_mildemaid_pop lhtw_multidemaid_pop lhtw_nopardemaid_pop lhtw_otherdemaid_pop lhtw_demdemaid_pop if year>1989  &  p_polity2_lag<10,p 

*** Skaaning et al.
sort ccode_cow year
by ccode_cow: gen liedlexical_index_lag = liedlexical_index[_n-1]
xtset ccode year, yearly

eststo: xtpcse liberal_lexical l.demaidcorepop l.allbutdemaidcorepop ///
l.unna_gdpc_1000 l.unna_otco l.unna_grgdp al_religion al_ethnic ///
easteur lat northafmideas subsahaf westeur eastas southeastas southas pacif ///
l.reg_monarchy l.reg_military l.reg_multiparty l.reg_noparty l.reg_other l.reg_democracy ///
lhtw_mondemaid_pop lhtw_mildemaid_pop lhtw_multidemaid_pop lhtw_nopardemaid_pop lhtw_otherdemaid_pop lhtw_demdemaid_pop if year>1989 &  liedlexical_index_lag<6,p 
		
*** Wahman et al.
eststo: xtpcse liberal_htw l.demaidcorepop l.allbutdemaidcorepop ///
l.unna_gdpc_1000 l.unna_otco l.unna_grgdp al_religion al_ethnic ///
easteur lat northafmideas subsahaf westeur eastas southeastas southas pacif ///
l.reg_monarchy l.reg_military l.reg_multiparty l.reg_noparty l.reg_other l.reg_democracy ///
lhtw_mondemaid_pop lhtw_mildemaid_pop lhtw_multidemaid_pop lhtw_nopardemaid_pop lhtw_otherdemaid_pop lhtw_demdemaid_pop if year>1989 & htw_ifhpol_lag <10,p 
	
*** V-Dem	
eststo: xtpcse liberal_vdem_elec l.demaidcorepop l.allbutdemaidcorepop ///
l.unna_gdpc_1000 l.unna_otco l.unna_grgdp al_religion al_ethnic ///
easteur lat northafmideas subsahaf westeur eastas southeastas southas pacif ///
l.reg_monarchy l.reg_military l.reg_multiparty l.reg_noparty l.reg_other l.reg_democracy ///
lhtw_mondemaid_pop lhtw_mildemaid_pop lhtw_multidemaid_pop lhtw_nopardemaid_pop lhtw_otherdemaid_pop lhtw_demdemaid_pop if year>1989 & vdem_v2x_polyarchy_lag <0.957,p 
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2 p, fmt(0 3 3) label("N" "R2" "Prob > F")) legend label





* 2. DEM/AUT only *
*-----------------*	
*** Freedom House
eststo clear
eststo: xtpcse liberal_fh_score l.demaidcorepop l.allbutdemaidcorepop ///
l.unna_gdpc_1000 l.unna_otco l.unna_grgdp al_religion al_ethnic ///
easteur lat northafmideas subsahaf westeur eastas southeastas southas pacif ///
l.reg_monarchy l.reg_military l.reg_multiparty l.reg_noparty l.reg_other l.reg_democracy ///
lhtw_mondemaid_pop lhtw_mildemaid_pop lhtw_multidemaid_pop lhtw_nopardemaid_pop lhtw_otherdemaid_pop lhtw_demdemaid_pop if year>1989 & fh_score_lag >=4,p 

*** Polity 
eststo: xtpcse liberal_polity l.demaidcorepop l.allbutdemaidcorepop ///
l.unna_gdpc_1000 l.unna_otco l.unna_grgdp al_religion al_ethnic ///
easteur lat northafmideas subsahaf westeur eastas southeastas southas pacif ///
l.reg_monarchy l.reg_military l.reg_multiparty l.reg_noparty l.reg_other l.reg_democracy ///
lhtw_mondemaid_pop lhtw_mildemaid_pop lhtw_multidemaid_pop lhtw_nopardemaid_pop lhtw_otherdemaid_pop lhtw_demdemaid_pop if year>1989  &  p_polity2_lag<=0,p 

*** Skaaning et al. 
* not estimated because the Lexical Index of Democracy does not allow for clear thresholds of dem / aut.		
			
*** Wahman et al.
eststo: xtpcse liberal_htw l.demaidcorepop l.allbutdemaidcorepop ///
l.unna_gdpc_1000 l.unna_otco l.unna_grgdp al_religion al_ethnic ///
easteur lat northafmideas subsahaf westeur eastas southeastas southas pacif ///
l.reg_monarchy l.reg_military l.reg_multiparty l.reg_noparty l.reg_other l.reg_democracy ///
lhtw_mondemaid_pop lhtw_mildemaid_pop lhtw_multidemaid_pop lhtw_nopardemaid_pop lhtw_otherdemaid_pop lhtw_demdemaid_pop if year>1989 & htw_ifhpol_lag <10,p 
		
*** V-Dem
* not estimated because V-Dem does not allow for clear thresholds of dem / aut.		

esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2 p, fmt(0 3 3) label("N" "R2" "Prob > F")) legend label




******************************************************************************************
**********************7. Ansell and Samuels 2010******************************************
******************************************************************************************

*** read in data
use "AnsSam CPS data_regimechangedata.dta", clear

tsset ccode year

*** replication of original models (Table 3, Models C and E)
eststo clear
eststo: xtreg  polity2 lagpolity Lagsbginiext  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year , fe cluster(ccode)
eststo: xtivreg  polity2 lagpolity (Lagsbginiext = regionlsbgini)  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year , fe 
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(3))) stats(N, fmt(0) label("N")) legend label


* 1. All observations *
*---------------------*	

*** Freedom House
eststo clear
eststo: xtreg  liberal_fh_score fh_score_lag Lagsbginiext  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year  if fh_score_lag >1, fe cluster(ccode)
eststo: xtivreg  liberal_fh_score fh_score_lag (Lagsbginiext = regionlsbgini)  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if fh_score_lag >1, fe 

*** Polity
eststo: xtreg  liberal_polity lagpolity Lagsbginiext  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if p_polity2_lag<10, fe cluster(ccode)
eststo: xtivreg  liberal_polity lagpolity (Lagsbginiext = regionlsbgini)  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if p_polity2_lag<10, fe
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2 p, fmt(0 3 3) label("N" "R2" "Prob > F")) legend label

*** Skaaning et al.
eststo clear
sort ccode_cow year
by ccode_cow: gen liedlexical_index_lag = liedlexical_index[_n-1]
eststo: xtreg  liberal_htw liedlexical_index_lag Lagsbginiext  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year  if liedlexical_index_lag <6, fe cluster(ccode) 
eststo: xtivreg  liberal_htw liedlexical_index_lag (Lagsbginiext = regionlsbgini)  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if liedlexical_index_lag <6, fe

*** Wahman et al.
eststo: xtreg  liberal_htw htw_ifhpol_lag Lagsbginiext  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year  if htw_ifhpol_lag <10, fe cluster(ccode) 
eststo: xtivreg  liberal_htw htw_ifhpol_lag (Lagsbginiext = regionlsbgini)  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if htw_ifhpol_lag <10, fe

*** V-Dem: electoral democracy
eststo: xtreg liberal_vdem_elec vdem_v2x_polyarchy_lag Lagsbginiext  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if vdem_v2x_polyarchy_lag <0.957, fe cluster(ccode) 
eststo: xtivreg liberal_vdem_elec vdem_v2x_polyarchy_lag (Lagsbginiext = regionlsbgini)  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if vdem_v2x_polyarchy_lag <0.957, fe
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2 p, fmt(0 3 3) label("N" "R2" "Prob > F")) legend label



* 2. DEM/AUT only *
*-----------------*	

*** Freedom House
eststo clear
eststo: xtreg  liberal_fh_score fh_score_lag Lagsbginiext  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year  if fh_score_lag >=4, fe cluster(ccode)
eststo: xtivreg  liberal_fh_score fh_score_lag (Lagsbginiext = regionlsbgini)  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if fh_score_lag >=4, fe 

*** Polity
eststo: xtreg  liberal_polity lagpolity Lagsbginiext  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year  if p_polity2_lag <=0, fe cluster(ccode)
eststo: xtivreg  liberal_polity lagpolity (Lagsbginiext = regionlsbgini)  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if p_polity2_lag <=0, fe

*** Skaaning et al.
* omitted, because the Lexical Index of Democracy does not allow for the identification of thresholds between dem/aut

*** Wahman et al.
eststo: xtreg  liberal_htw htw_ifhpol_lag Lagsbginiext  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year  if htw_ifhpol_lag <7, fe cluster(ccode) 
eststo: xtivreg  liberal_htw htw_ifhpol_lag (Lagsbginiext = regionlsbgini)  LagMadgdpcapINT  LagRuralInequality  LagVHknowledgeINT year if htw_ifhpol_lag <7, fe 

*** V-Dem: electoral democracy
* omitted, because V-Dem does not allow for the identification of thresholds between dem/aut

esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(4)) se(par fmt(4))) stats(N r2 p, fmt(0 3 3) label("N" "R2" "Prob > F")) legend label



******************************************************************************************
**********************8. Gibler and Randazzo 2011*****************************************
******************************************************************************************

*** read in data
use "Gibler_Randazzo_regimechangedata.dta", clear

*** replication of original model: T2, M2
eststo clear
eststo: logit negpolchg oldj newj l1 lngdpl age_democl hist_revert_polityl econ_crisis_3percentl terr_rivl militarize_neighborl if polityl>-7
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N chi2 p r2_p, fmt(0 3 3 3) label("N" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend label


* 1. All observations *
*---------------------*	
*** Freedom House
eststo clear
eststo: logit backslide_fh_score oldj newj l1 lngdpl age_democl hist_revert_polityl econ_crisis_3percentl terr_rivl militarize_neighborl if fh_score_lag <7

*** Polity
eststo: logit backslide_polity oldj newj l1 lngdpl age_democl hist_revert_polityl econ_crisis_3percentl terr_rivl militarize_neighborl if p_polity2_lag>-10

*** Skaaning et al.
sort ccode_cow year
by ccode_cow: gen liedlexical_index_lag = liedlexical_index[_n-1]
eststo: logit backslide_lexical oldj newj l1 lngdpl age_democl hist_revert_polityl econ_crisis_3percentl terr_rivl militarize_neighborl if liedlexical_index_lag >0 & liedlexical_index_lag !=.

*** Wahman et al. 
eststo: logit backslide_htw oldj newj l1 lngdpl age_democl hist_revert_polityl econ_crisis_3percentl terr_rivl militarize_neighborl if htw_ifhpol_lag >0

*** V-Dem: electoral democracy
eststo: logit backslide_vdem_elec oldj newj l1 lngdpl age_democl hist_revert_polityl econ_crisis_3percentl terr_rivl militarize_neighborl ///
   if vdem_v2x_polyarchy_lag>0.043 & vdem_v2x_polyarchy_lag !=. 
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N chi2 p r2_p, fmt(0 3 3 3) label("N" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend label

 
* 2. DEM/AUT only *
*-----------------*	

*** Freedom House
eststo clear
eststo: logit backslide_fh_score oldj newj l1 lngdpl age_democl hist_revert_polityl econ_crisis_3percentl terr_rivl militarize_neighborl if fh_score_lag <4

*** Polity
eststo: logit backslide_polity oldj newj l1 lngdpl age_democl hist_revert_polityl econ_crisis_3percentl terr_rivl militarize_neighborl if p_polity2_lag>0

*** Skaaning et al.
* cannot be estimated: Lexical Index of Democracy does not offer clear thresholds between democracy and autocracy

** Wahman et al.
eststo: logit backslide_htw oldj newj l1 lngdpl age_democl hist_revert_polityl econ_crisis_3percentl terr_rivl militarize_neighborl if htw_ifhpol_lag >=7

*** V-Dem: electoral democracy
* cannot be estimated: V-Dem does not offer clear thresholds between democracy and autocracy
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N chi2 p r2_p, fmt(0 3 3 3) label("N" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend label



******************************************************************************************
**********************9. Goldstone et al. 2010********************************************
******************************************************************************************

*** read in data
use "Goldstone et al._regimechangedata.dta", clear

*** replication of original model (T1, M3)
eststo clear
eststo: clogit sftpcons sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==3 & reg_ind=="Y", group(stratidc) or
esttab, star(* 0.05 ** 0.01 *** 0.001) cells(b(star fmt(3)) se(par fmt(2))) stats(N chi2 p r2_p, fmt(0 3 3 3) label("N" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend label eform


* 1. All observations *
*---------------------*	

*** Freedom House
eststo clear
eststo: clogit backslide_fh_score sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==3 & reg_ind=="Y" & fh_score_lag <7, group(stratidc) or

*** Polity
eststo: clogit backslide_polity sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==3 & reg_ind=="Y" & p_polity2_lag>-10, group(stratidc) or

*** Skaaning et al.
sort ccode_cow year
by ccode_cow: gen liedlexical_index_lag = liedlexical_index[_n-1]
eststo: clogit backslide_lexical sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==3 & reg_ind=="Y" & liedlexical_index_lag > 0, group(stratidc) or

*** Wahman et al.
eststo: clogit backslide_htw sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==3 & reg_ind=="Y" & htw_ifhpol_lag > 0, group(stratidc) or

*** V-Dem: electoral democracy
eststo: clogit backslide_vdem_elec sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==3 & reg_ind=="Y" & ///
   vdem_v2x_polyarchy_lag > 0.043 & vdem_v2x_polyarchy_lag !=. , group(stratidc) or
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N chi2 p r2_p, fmt(0 3 3 3) label("N" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend label



* 2. DEM/AUT only *
*-----------------*	

*** Freedom House
eststo clear
eststo: clogit backslide_fh_score sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==3 & reg_ind=="Y" & fh_score_lag <4, group(stratidc) or

*** Polity
eststo: clogit backslide_polity sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==3 & reg_ind=="Y" & p_polity2_lag>0, group(stratidc) or

*** Skaaning et al.
* no thresholds between DEM/AUT on Lexical Index of Democracy

*** Wahman et al.
eststo: clogit backslide_htw sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==3 & reg_ind=="Y" & htw_ifhpol_lag > 7, group(stratidc) or

*** V-Dem: electoral democracy
* no thresholds between DEM/AUT on V-Dem
esttab, star(* 0.10 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(2))) stats(N chi2 p r2_p, fmt(0 3 3 3) label("N" "Chi2" "Prob>Chi2" "Pseudo-R2")) legend label





